<template>
	<view class="container" >
		<view 
		v-for="(dateItem1,index1) in list1" 
		:key="index1" 
		class='item'
		@click="outDate(dateItem1)">	
		   {{dateItem1}}
	    </view>
		
		<view
		v-for="(dateItem2,index2) in list2" 
		:key="index2" 
		class='item'
		@click="outDate(dateItem2)">	
		   {{dateItem2}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1:[],
				dataItem1:"",
				list2:[],
				dataItem2:"",
				
			}
		},
		
		onLoad(res){
			console.log(res.mode1,res.mode2)
			let _that=this;
			let data1={
				mode:res.mode1,
			};
			_that.$myRequest("/history/searchNameByMode","POST",data1,function(res){
				_that.list1=res.data.list
				console.log("that-list1",_that.list1);
				
			});
			
			let data2={
				mode:res.mode2,
			};
			_that.$myRequest("/history/searchNameByMode","POST",data2,function(res){
				_that.list2=res.data.list
				console.log("thatlist2",_that.list2);
				
			});
		},
		
		methods: {
			outDate(dateItem){
				let that =this;
				console.log("dateItem",dateItem)
				//const uuid=uni.getStorageSync("uuid")
				//console.log("uuid",uuid)
				wx.downloadFile({
				      url: "http://43.139.95.60:4005/excel/706655b1367b/"+dateItem,
				      success(res){
				        const filePath=res.tempFilePath
				        wx.openDocument({
				          filePath: filePath,
				          showMenu:true
				    
				        })
				      }
				    })

           }
		}
	}
</script>

<style>
	.container{
		margin-top: 20rpx;
		display:flex;
		flex-direction: column;
		text-align: center;
		justify-content:center;
	}
	.item{
		width:100%;
		display: flex;
		flex-direction: column;
		margin: 20rpx 0rpx;
		border-radius: 60rpx;
		padding:20rpx  0rpx;
		/*  阴影 */
		box-shadow: 0 0 20rpx rgba(0, 0, 0, 0.15);
		
	}

</style>
